import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
import Layout from '@/components/layout/index.vue'

const routes: RouteRecordRaw[] = [{
    path: '/',
    component: Layout,
    redirect: '/home',
    children: [{
        path: '/home',
        name: 'home',
        component: () => import('../pages/HomePage.vue'),
        meta: {
            title: '首页',
            icon: '',
        },
    }, {
        path: '/map',
        name: 'map',
        component: () => import('../pages/MapPage.vue'),
        meta: {
            title: '地图',
            icon: '',
        },
    }, {
        path: '/about',
        name: 'about',
        component: () => import('../pages/About.vue'),
        meta: {
            title: '关于本站点',
            icon: '',
        },
    }]
}]

const router = createRouter({
    history: createWebHistory(),
    routes,
})

export default router
